<%= form_for private_topic,
             url: private_topic.submit_path,
             html: {
                 class: "thredded--form thredded--new-private-topic-form #{local_assigns[:css_class]}",
                 'data-thredded-topic-form' => true,
                 # TODO: only autocomplete users in this private topic
                 'data-autocomplete-url' => autocomplete_users_path,
                 'data-autocomplete-min-length' => Thredded.autocomplete_min_length,
                 'data-thredded-submit-hotkey' => true,
             } do |form| %>

  <ul class="thredded--form-list on-top">
    <li class="title">
      <%= form.label :title, t('thredded.private_topics.form.title_label') %>
      <%= form.text_field :title, placeholder: placeholder, required: true, autocomplete: 'off' %>
      <%= render 'thredded/shared/field_errors', messages: form.object.errors[:title] %>
    </li>
    <li>
      <%= form.label :user_names, t('thredded.private_topics.form.users_label') %>
      <%= form.text_area :user_names,
                         required: true,
                         placeholder: t('thredded.private_topics.form.users_placeholder'),
                         'data-thredded-users-select' => true,
                         'data-autocomplete-url' => autocomplete_users_path,
                         'data-autocomplete-min-length' => Thredded.autocomplete_min_length,
                         rows: 1 %>
    </li>

    <%= render 'thredded/posts_common/form/content',
               form: form,
               content_label: t('thredded.private_topics.form.content_label'),
               preview_url: private_topic.preview_path %>

    <li>
      <button type="submit" class="thredded--form--submit"
              data-disable-with="<%= t 'thredded.private_topics.form.create_btn_submitting' %>">
        <%= t('thredded.private_topics.form.create_btn') %>
      </button>
    </li>
  </ul>
<% end %>

